﻿using Common.Data.Extensions;
using CrossSelling.Model.Model;
using CrossSelling.Core.Configuration;

namespace CrossSelling.Core.Data.DBConfig
{
    public class CustomersConfiguration : DBConfig<Customers>
    {
        public CustomersConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.Cif });

            //relationship
            HasOptional(o => o.PreApprovedCreditCard87s).WithRequired(r => r.Customers).WillCascadeOnDelete(false);
        }
    }
}